import {getAllUsers} from "../api/user";

//从api给的用户中找到id对应的用户
function findPerson (id) {
    let users = getAllUsers();
    let current = users.station.find(person => person.id == id);
    if (typeof (current) == "undefined") {
        for (let i = 0; i < users.office.length; i++) {
            current = users.office[i].doctors.find(person => person.id == id);
            if (typeof (current) != "undefined") break;
        }
    }
    return current;
}

export {
    findPerson
}